﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DotNetMigrations.Commands
{
	[ConsoleCommand("generate")]
	public class GenerateCmd : ConsoleCommand
	{
		public GenerateCmd(string[] args) : base(args) { }

		private string _migrationName;

		public override bool ValidateArgs()
		{
			if (ArgCount < 1)
			{
				Output.Warn("Migration name not specified");
				return false;
			}

			_migrationName = Args[0];
			return true;
		}

		public override bool Run()
		{
			return MigrationScript.Generate(_migrationName);
		}
	}
}
